<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 5.4.0">
  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">


<link rel="stylesheet" href="/lib/font-awesome/css/all.min.css">

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"inkgn.gitee.io","root":"/","scheme":"Muse","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":false,"show_result":false,"style":null},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":false,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}}};
  </script>

  <meta name="description" content="长路漫漫，半程风雨，半程春">
<meta property="og:type" content="website">
<meta property="og:title" content="静水深流">
<meta property="og:url" content="https://inkgn.gitee.io/index.html">
<meta property="og:site_name" content="静水深流">
<meta property="og:description" content="长路漫漫，半程风雨，半程春">
<meta property="og:locale" content="zh_CN">
<meta property="article:author" content="yinks">
<meta name="twitter:card" content="summary">

<link rel="canonical" href="https://inkgn.gitee.io/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : true,
    isPost : false,
    lang   : 'zh-CN'
  };
</script>

  <title>静水深流</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <h1 class="site-title">静水深流</h1>
      <span class="logo-line-after"><i></i></span>
    </a>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
    </div>
  </div>
</div>




<nav class="site-nav">
  <ul id="menu" class="main-menu menu">
        <li class="menu-item menu-item-home">

    <a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a>

  </li>
        <li class="menu-item menu-item-categories">

    <a href="/categories/categories" rel="section"><i class="fa fa-th fa-fw"></i>分类</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a>

  </li>
        <li class="menu-item menu-item-motto">

    <a href="/motto/motto" rel="section"><i class="fa fa-book fa-fw"></i>古训</a>

  </li>
        <li class="menu-item menu-item-about">

    <a href="/about/me" rel="section"><i class="fa fa-user fa-fw"></i>关于</a>

  </li>
  </ul>
</nav>




</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content index posts-expand">
            
      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://inkgn.gitee.io/2023/03/14/article39/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="https://blog-1253246719.cos.ap-chengdu.myqcloud.com/blog/user_info/face">
      <meta itemprop="name" content="yinks">
      <meta itemprop="description" content="长路漫漫，半程风雨，半程春">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="静水深流">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/2023/03/14/article39/" class="post-title-link" itemprop="url">less样式名称不变全局生效，React 打包出错 index.1c3e04b4.js from UglifyJs</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>
              

              <time title="创建时间：2023-03-14 18:38:12 / 修改时间：19:06:00" itemprop="dateCreated datePublished" datetime="2023-03-14T18:38:12+08:00">2023-03-14</time>
            </span>

          

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <h3 id="less样式名称不变全局生效"><a href="#less样式名称不变全局生效" class="headerlink" title="less样式名称不变全局生效"></a>less样式名称不变全局生效</h3><p>less代码在经过编译后会自动给样式名称添加哈希数字作为唯一分辨，它们的使用方法通常是下面这样的才会正常生效</p>
          <!--noindex-->
            <div class="post-button">
              <a class="btn" href="/2023/03/14/article39/#more" rel="contents">
                阅读全文 &raquo;
              </a>
            </div>
          <!--/noindex-->
        
      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://inkgn.gitee.io/2022/12/06/article38/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="https://blog-1253246719.cos.ap-chengdu.myqcloud.com/blog/user_info/face">
      <meta itemprop="name" content="yinks">
      <meta itemprop="description" content="长路漫漫，半程风雨，半程春">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="静水深流">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/2022/12/06/article38/" class="post-title-link" itemprop="url">git  | 不同分支提交到不同的远程仓库</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2022-12-06 09:48:21" itemprop="dateCreated datePublished" datetime="2022-12-06T09:48:21+08:00">2022-12-06</time>
            </span>

          

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <h4 id="不同分支提交到不同的远程仓库"><a href="#不同分支提交到不同的远程仓库" class="headerlink" title="不同分支提交到不同的远程仓库"></a>不同分支提交到不同的远程仓库</h4><ul>
<li><p>git创建一个新的本地分支</p>
<blockquote>
<p>此分支尚未关联远程仓库<br>命令：<strong>git checkout -b [new branchName]</strong></p>
</blockquote>
</li>
<li><p>git新增一个远程地址</p>
<blockquote>
<p>当我们关联一个远程仓库时默认使用的远程主机名称是<strong>origin</strong>，当我们需要关联第二个远程地址时需要自定义主机名称<br>命令：<strong>git remote add [新的远程主机名称] [远程地址/url/ssh]</strong><br>通过此命令你本地已经关联了两个远程地址，通过命令<strong>git remote -v</strong>查看</p>
</blockquote>
</li>
<li><p>将代码上传到新的远程仓库中</p>
<blockquote>
<p>命令:<strong>git push –set-upstream [新的远程主机名称] [远程分支名称]</strong><br>此时你的代码已经上传到新的远程仓库了，这里远程分支名称可以自定义，建议把远程分支名称和本地分支保持一致</p>
</blockquote>
</li>
</ul>
          <!--noindex-->
            <div class="post-button">
              <a class="btn" href="/2022/12/06/article38/#more" rel="contents">
                阅读全文 &raquo;
              </a>
            </div>
          <!--/noindex-->
        
      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://inkgn.gitee.io/2022/04/13/article37/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="https://blog-1253246719.cos.ap-chengdu.myqcloud.com/blog/user_info/face">
      <meta itemprop="name" content="yinks">
      <meta itemprop="description" content="长路漫漫，半程风雨，半程春">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="静水深流">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/2022/04/13/article37/" class="post-title-link" itemprop="url">git  | git常见问题集合(本地分支和远程分支的关联)</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2022-04-13 11:49:11" itemprop="dateCreated datePublished" datetime="2022-04-13T11:49:11+08:00">2022-04-13</time>
            </span>

          

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <h4 id="分支篇"><a href="#分支篇" class="headerlink" title="分支篇"></a>分支篇</h4><ul>
<li><p>git本地分支与远程分支关联</p>
<blockquote>
<p>此情景为本地已创建<code>develop</code>分支,且远程已创建<code>develop</code>分支</p>
<p>命令:<strong>git branch –set-upstream-to=origin/develop(远程分支名) develop(本地分支名)</strong></p>
<p>通过此命令后,可直接使用<code>git pull </code>拉取分支最新内容</p>
</blockquote>
</li>
<li><p>git 克隆指定分支代码</p>
<blockquote>
<p>当需要克隆指定分支的代码时可以使用此命令</p>
<p>命令:<strong>git clone -b v2.8.1(分支名称) <a target="_blank" rel="noopener" href="https://git.xxx.git/">https://git.xxx.git</a></strong></p>
</blockquote>
</li>
<li><p>2.如果本地新建了一个分支<code>branch_name</code>，但是在远程没有</p>
<blockquote>
<p>如果本地新建了一个分支<code>branch_name</code>，但是在远程没有，这时候<code>push</code>和<code>pull</code>指令就无法确定该跟踪谁,一般来说我们都会使其跟踪远程同名分支，所以可以利用<code>git push --set-upstream origin branch_name</code>，这样就可以自动在远程创建一个<code>branch_name</code>分支，然后本地分支会<code>track</code>该分支。后面再对该分支使用<code>push</code>和<code>pull</code>就自动同步。无需再指定分支。</p>
</blockquote>
</li>
<li><p>如果远程新建了一个分支，本地没有该分支</p>
<blockquote>
<p>1）如果远程新建了一个分支，本地没有该分支，可以用<code>git checkout --track origin/branch_name</code>，这时候本地会新建一个分支名叫<code>branch_name</code>，会自动跟踪远程的同名分支<code>branch_name</code>。<br>2）用上面中方法，得到的分支名永远和远程的分支名一样，如果想新建一个本地分支不同名字，同时跟踪一个远程分支可以利用。<br><code>git checkout -b new_branch_name branch_name</code>，这条指令本来是根据一个<code>branch_name</code>分支分出一个本地分支<code>new_branch_name</code>，但是如果所根据的分支<code>branch_name</code>是一个远程分支名，那么本地的分支会自动的track远程分支。建议跟踪分支和被跟踪远程分支同名。</p>
</blockquote>
</li>
</ul>
          <!--noindex-->
            <div class="post-button">
              <a class="btn" href="/2022/04/13/article37/#more" rel="contents">
                阅读全文 &raquo;
              </a>
            </div>
          <!--/noindex-->
        
      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://inkgn.gitee.io/2022/02/08/article36/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="https://blog-1253246719.cos.ap-chengdu.myqcloud.com/blog/user_info/face">
      <meta itemprop="name" content="yinks">
      <meta itemprop="description" content="长路漫漫，半程风雨，半程春">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="静水深流">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/2022/02/08/article36/" class="post-title-link" itemprop="url">git  | git常见问题及常见命令</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2022-02-08 11:49:11" itemprop="dateCreated datePublished" datetime="2022-02-08T11:49:11+08:00">2022-02-08</time>
            </span>

          

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <ul>
<li>git解决每次拉取代码都需要用户名密码</li>
</ul>
<blockquote>
<p>执行<code>git config --global credential.helper store</code>，在<code>~/.gitconfig</code>目录下会多出一个文件，这里会记录你的密码和帐号；</p>
<p><em>再执行<code>git pull </code>输入一次正确的帐号密码之后就不用再输入了。</em></p>
</blockquote>
          <!--noindex-->
            <div class="post-button">
              <a class="btn" href="/2022/02/08/article36/#more" rel="contents">
                阅读全文 &raquo;
              </a>
            </div>
          <!--/noindex-->
        
      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://inkgn.gitee.io/2021/11/30/article34/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="https://blog-1253246719.cos.ap-chengdu.myqcloud.com/blog/user_info/face">
      <meta itemprop="name" content="yinks">
      <meta itemprop="description" content="长路漫漫，半程风雨，半程春">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="静水深流">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/2021/11/30/article34/" class="post-title-link" itemprop="url">Vue  | vue中的文字滚动广播实现</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2021-11-30 11:49:11" itemprop="dateCreated datePublished" datetime="2021-11-30T11:49:11+08:00">2021-11-30</time>
            </span>

          

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <h3 id="需求"><a href="#需求" class="headerlink" title="需求"></a>需求</h3><p>页面头部加入广播功能，由后端提供数据，滚动播放每一条</p>
          <!--noindex-->
            <div class="post-button">
              <a class="btn" href="/2021/11/30/article34/#more" rel="contents">
                阅读全文 &raquo;
              </a>
            </div>
          <!--/noindex-->
        
      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://inkgn.gitee.io/2021/11/28/article33/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="https://blog-1253246719.cos.ap-chengdu.myqcloud.com/blog/user_info/face">
      <meta itemprop="name" content="yinks">
      <meta itemprop="description" content="长路漫漫，半程风雨，半程春">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="静水深流">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/2021/11/28/article33/" class="post-title-link" itemprop="url">nodejs  | 我用node写爬虫</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>
              

              <time title="创建时间：2021-11-28 11:49:11 / 修改时间：12:46:00" itemprop="dateCreated datePublished" datetime="2021-11-28T11:49:11+08:00">2021-11-28</time>
            </span>

          

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <p>最近经过跟组内大佬亲切交谈后，大佬建议前端应该要了解一下后端。而对于前端人员来说，最快的方式可能就是通过nodejs了。</p>
<p>说干就干，都说兴趣是最好的老师，对于枯燥的文档实在是很难坚持看下去，所以我觉得先通过node爬虫的方式简单的，打个招呼吧</p>
          <!--noindex-->
            <div class="post-button">
              <a class="btn" href="/2021/11/28/article33/#more" rel="contents">
                阅读全文 &raquo;
              </a>
            </div>
          <!--/noindex-->
        
      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://inkgn.gitee.io/2021/11/27/article32/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="https://blog-1253246719.cos.ap-chengdu.myqcloud.com/blog/user_info/face">
      <meta itemprop="name" content="yinks">
      <meta itemprop="description" content="长路漫漫，半程风雨，半程春">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="静水深流">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/2021/11/27/article32/" class="post-title-link" itemprop="url">flexible+postcss-plugin-px2rem+rem 大屏，H5多端适配实现</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>
              

              <time title="创建时间：2021-11-27 10:53:49 / 修改时间：10:56:28" itemprop="dateCreated datePublished" datetime="2021-11-27T10:53:49+08:00">2021-11-27</time>
            </span>

          

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <h4 id="安装"><a href="#安装" class="headerlink" title="安装"></a>安装</h4><ul>
<li><p>flexible ：阿里旗下，手淘移动端适配方案，会根据窗口大小动态修改web页面中html根标签的<strong>font-size</strong>大小</p>
<blockquote>
<p>计算公式：假设将设计稿宽度均分为10份，每一份的宽度为1rem的真实宽度（页面实时宽度/设计稿宽度）*（设计稿宽度/10） = 页面根标签html的<strong>font-size</strong>大小  <a target="_blank" rel="noopener" href="https://github.com/beipiaoyu2011/flexible">下载地址</a></p>
</blockquote>
</li>
<li><p>postcss-plugin-px2rem：px转rem，px是以像素为单位，在当前高清屏热潮下，适配是个困难的问题，rem就可以通过html根标签动态改变像素大小，用来适配不同分辨率下的web页面 <a target="_blank" rel="noopener" href="https://www.npmjs.com/package/postcss-plugin-px2rem">下载地址</a></p>
</li>
</ul>
          <!--noindex-->
            <div class="post-button">
              <a class="btn" href="/2021/11/27/article32/#more" rel="contents">
                阅读全文 &raquo;
              </a>
            </div>
          <!--/noindex-->
        
      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://inkgn.gitee.io/2021/11/26/article35/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="https://blog-1253246719.cos.ap-chengdu.myqcloud.com/blog/user_info/face">
      <meta itemprop="name" content="yinks">
      <meta itemprop="description" content="长路漫漫，半程风雨，半程春">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="静水深流">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/2021/11/26/article35/" class="post-title-link" itemprop="url">Vue  | 11月疑难杂症踩坑聚合篇</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2021-11-26 11:49:11" itemprop="dateCreated datePublished" datetime="2021-11-26T11:49:11+08:00">2021-11-26</time>
            </span>

          

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <p>Vue 子组件data 接收 props数据无法自动更新问题 </p>
<p>Vue中父组件在通过props向子组件传递数据时，其过程是在子组件的mounted生命周期中进行处理的，当Vue初始渲染时子组件执行props并将其数据赋值给自身data中，当初次渲染完成后，父组件中数据发生变更，props也会变更（vue-tools）可查看状态，但是子组件本身data并不会更新，因为赋值过程仅在mounted钩子函数中进行，此时已经经过挂载阶段，从而无法捕获数据，达到更新效果。 </p>
          <!--noindex-->
            <div class="post-button">
              <a class="btn" href="/2021/11/26/article35/#more" rel="contents">
                阅读全文 &raquo;
              </a>
            </div>
          <!--/noindex-->
        
      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://inkgn.gitee.io/2021/11/13/article31/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="https://blog-1253246719.cos.ap-chengdu.myqcloud.com/blog/user_info/face">
      <meta itemprop="name" content="yinks">
      <meta itemprop="description" content="长路漫漫，半程风雨，半程春">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="静水深流">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/2021/11/13/article31/" class="post-title-link" itemprop="url">Vue + Element + Select 获取选中对象数据</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>
              

              <time title="创建时间：2021-11-13 17:50:45 / 修改时间：12:57:14" itemprop="dateCreated datePublished" datetime="2021-11-13T17:50:45+08:00">2021-11-13</time>
            </span>

          

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br></pre></td><td class="code"><pre><span class="line">&lt;el-select</span><br><span class="line"> <span class="comment">// 绑定选择数据</span></span><br><span class="line"> v-model=<span class="string">&quot;value&quot;</span></span><br><span class="line"> <span class="comment">// 文字提示</span></span><br><span class="line"> placeholder=<span class="string">&quot;Area selection&quot;</span></span><br><span class="line"> <span class="comment">// input改变触发事件</span></span><br><span class="line"> @change=<span class="string">&quot;open($event)&quot;</span></span><br><span class="line"> <span class="comment">// 定义下拉框class</span></span><br><span class="line"> <span class="class"><span class="keyword">class</span></span>=<span class="string">&quot;Home-header-right02&quot;</span></span><br><span class="line"> <span class="comment">// 定义下拉展示框class</span></span><br><span class="line"> popper-<span class="class"><span class="keyword">class</span></span>=<span class="string">&quot;Home-header-select&quot;</span></span><br><span class="line"> <span class="comment">// 是否允许清除选中项</span></span><br><span class="line"> clearable</span><br><span class="line"> <span class="comment">// 是否允许下拉框输入</span></span><br><span class="line"> filterable</span><br><span class="line"> <span class="comment">// 下拉框大小</span></span><br><span class="line"> size=<span class="string">&quot;medium&quot;</span></span><br><span class="line">&gt;</span><br><span class="line"> <span class="xml"><span class="tag">&lt;<span class="name">el-option</span></span></span></span><br><span class="line"><span class="tag"><span class="xml">   <span class="attr">v-for</span>=<span class="string">&quot;item in options&quot;</span></span></span></span><br><span class="line"><span class="tag"><span class="xml">   <span class="attr">:key</span>=<span class="string">&quot;item.name&quot;</span></span></span></span><br><span class="line"><span class="tag"><span class="xml">   <span class="attr">:label</span>=<span class="string">&quot;item.name&quot;</span></span></span></span><br><span class="line"><span class="tag"><span class="xml">   </span></span></span><br><span class="line"><span class="tag"><span class="xml">   // 重要，<span class="attr">value</span>设置为<span class="attr">item.xx</span>后，<span class="attr">change</span>事件仅能获取<span class="attr">item.xx</span>，当<span class="attr">value</span>设置为<span class="attr">item</span>后 <span class="attr">change</span>可获取整个<span class="attr">item</span>对象</span></span></span><br><span class="line"><span class="tag"><span class="xml">   </span></span></span><br><span class="line"><span class="tag"><span class="xml">   <span class="attr">:value</span>=<span class="string">&quot;item&quot;</span>&gt;</span></span></span><br><span class="line"><span class="xml"> <span class="tag">&lt;/<span class="name">el-option</span>&gt;</span></span></span><br><span class="line"></span><br><span class="line"></span><br><span class="line">&lt;/el-select&gt;</span><br><span class="line"></span><br><span class="line"><span class="function"><span class="title">open</span>(<span class="params">e</span>)</span> &#123;</span><br><span class="line"><span class="comment">// 此时e为一个对象</span></span><br><span class="line"><span class="keyword">if</span>(!e) <span class="keyword">return</span>;</span><br><span class="line"> <span class="built_in">this</span>.tolinks.dialogState = <span class="literal">true</span>;</span><br><span class="line"> <span class="built_in">this</span>.tolinks.markedId = e.markedId;</span><br><span class="line"> <span class="built_in">this</span>.tolinks.market = e.area;</span><br><span class="line">&#125;,</span><br><span class="line"></span><br></pre></td></tr></table></figure>

<h3 id="Vue-组件-props-对象传递及默认值问题"><a href="#Vue-组件-props-对象传递及默认值问题" class="headerlink" title="Vue 组件 props 对象传递及默认值问题"></a>Vue 组件 props 对象传递及默认值问题</h3>
          <!--noindex-->
            <div class="post-button">
              <a class="btn" href="/2021/11/13/article31/#more" rel="contents">
                阅读全文 &raquo;
              </a>
            </div>
          <!--/noindex-->
        
      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://inkgn.gitee.io/2021/11/10/article30/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="https://blog-1253246719.cos.ap-chengdu.myqcloud.com/blog/user_info/face">
      <meta itemprop="name" content="yinks">
      <meta itemprop="description" content="长路漫漫，半程风雨，半程春">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="静水深流">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/2021/11/10/article30/" class="post-title-link" itemprop="url">Vue 模糊查询实现数据防抖节流</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2021-11-10 15:50:31" itemprop="dateCreated datePublished" datetime="2021-11-10T15:50:31+08:00">2021-11-10</time>
            </span>
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="far fa-calendar-check"></i>
                </span>
                <span class="post-meta-item-text">更新于</span>
                <time title="修改时间：2021-11-13 12:56:15" itemprop="dateModified" datetime="2021-11-13T12:56:15+08:00">2021-11-13</time>
              </span>

          

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <h4 id="写在前面"><a href="#写在前面" class="headerlink" title="写在前面"></a>写在前面</h4><p>这里踩了个坑，在查看<strong>elementUI</strong>官方文档时没有注意版本号，我们项目中使用的是是2.15+ ，在看文档时使用的是低版本文档，导致很多内置事件跟在实际使用中有差异，事实上<strong>elementUI</strong>针对input是有做过针对输入事件的防抖的，但是木已成舟，这里还是讲一下自己的实现思路吧。</p>
          <!--noindex-->
            <div class="post-button">
              <a class="btn" href="/2021/11/10/article30/#more" rel="contents">
                阅读全文 &raquo;
              </a>
            </div>
          <!--/noindex-->
        
      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  


  
  <nav class="pagination">
    <span class="page-number current">1</span><a class="page-number" href="/page/2/">2</a><span class="space">&hellip;</span><a class="page-number" href="/page/6/">6</a><a class="extend next" rel="next" href="/page/2/"><i class="fa fa-angle-right" aria-label="下一页"></i></a>
  </nav>



          </div>
          

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="yinks"
      src="https://blog-1253246719.cos.ap-chengdu.myqcloud.com/blog/user_info/face">
  <p class="site-author-name" itemprop="name">yinks</p>
  <div class="site-description" itemprop="description">长路漫漫，半程风雨，半程春</div>
</div>
  <div class="links-of-author motion-element">
      <span class="links-of-author-item">
        <a href="https://gitee.com/inkgn" title="Gitee → https:&#x2F;&#x2F;gitee.com&#x2F;inkgn" rel="noopener" target="_blank"><i class="fab fa-github fa-fw"></i>Gitee</a>
      </span>
      <span class="links-of-author-item">
        <a href="/2087104694@qq.com" title="E-Mail → 2087104694@qq.com"><i class="fa fa-envelope fa-fw"></i>E-Mail</a>
      </span>
  </div>



      </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

        

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2023</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">yinks</span>
</div>
  <div class="powered-by">由 <a href="https://hexo.io/" class="theme-link" rel="noopener" target="_blank">Hexo</a> & <a href="https://muse.theme-next.org/" class="theme-link" rel="noopener" target="_blank">NexT.Muse</a> 强力驱动
  </div>

        








      </div>
    </footer>
  </div>

  
  <script src="/lib/anime.min.js"></script>
  <script src="/lib/velocity/velocity.min.js"></script>
  <script src="/lib/velocity/velocity.ui.min.js"></script>

<script src="/js/utils.js"></script>

<script src="/js/motion.js"></script>


<script src="/js/schemes/muse.js"></script>


<script src="/js/next-boot.js"></script>




  















  

  

</body>
</html>
